﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Things.OrderPlan;
using Things.OrderPlan.Models;

namespace Things.Web.OrderPlan
{
    public partial class Ordering : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid goodsId = new Guid(Request.QueryString["goodsid"]);
            Guid setId = new Guid(Request.QueryString["setid"]);

            SaleSet set = new SaleSetRepository().Find(setId);
            if (set == null)
            {
                //自定义套餐
            }
            else
            {
                //
                OrderPlanCartUtil.RemoveAll(this.Context);

                //
                OrderPlanCartUtil.Ordering(
                    this.Context,
                    set.Id,
                    set.GoodsId,
                    set.DeliveredCount,
                    set.DeliveredCycle,
                    set.DeliveredNumber,
                    "~/OrderPlan/OrderPlanCart.aspx");
            }
        }
    }
}